
<!DOCTYPE HTML> 
<html>
<head>
<meta charset="utf-8">
<title>TouchSlider</title>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no'/> 
<link  href="css/goods-detail.css" rel='stylesheet'/>
<script src="./js/jquery-1.10.2.js"></script>
<script src="js/all.js"></script>
<script src="js/url.js" type="text/javascript" charset="utf-8"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<div class='swipe'>
  <ul id='slider4'>
    <!--<li style='display:block'><a href="#"><img src="img/goods.png" alt="" /></a></li>-->
    <!--<li><img src="img/goods.png" alt="" /></li>-->
    <!--<li><img src="img/goods.png" alt="" /></li>-->
    <!--<li><img src="img/goods.png" alt="" /></li>-->
    
  </ul>
  <div id="pagenavi">
		<div class="pagenavi1">
    	<!--<a href="#" class="active"></a>-->
		<!--<a href="#"></a>-->
		<!--<a href="#"></a>-->
		<!--<a href="#"></a>-->
    	</div>
  </div>
  <a class="return-btn" onclick="go()"><img src="img/arrow.png"></a>
</div>

<h2 class="title-main"></h2>
<h2 class="price">￥<span id="price"></span></h2>
<div class="goods-basic">
	<div style=' text-align:left'>快递：<span id="freightPrice"></span></div>
    <div style=' text-align:center'>月销：<span>500</span></div>
    <div style=' text-align:right'><span>北京</span></div>
</div>
<span class="dl"></span>
<div class="coupon">
	<div>
     <span class="coupon-show">优惠券</span>
     <h1 class="coupon-title">无</h1>
    </div>
    <a> <img src="img/arrowr.png"></a>
</div>
<span class="dl"></span>

<div class="goods-ce">
	<h1>商品评价</h1>
    <a> <img src="img/arrowr.png"></a>
    <!--<div class="ce-detail">-->
    	<!--<div class="ce-top">-->
        	<!--<img src="img/513277.png">-->
            <!--<span class="ce-name">张三</span>-->
            <!--<span class="ce-time">1月10日	09:06</span>-->
        <!--</div>-->
        <!--<p class="ce-text">宝贝很好呢，我很喜欢，下次还会加购哦！</p>-->
        <!--<img src="img/meinv.png" class="ce-img">-->
    <!--</div>-->
    <div class="ce-all">查看全部评价</div>
</div>

<span class="dl"></span>

<div class="goods-detail">
	<h1>商品详情</h1>
	<!--<img src="img/yifu.png">-->
</div>

<div class="goods-btns">
	<div class="btn">
    	<img src="img/am.png">
        <span>客服</span>
    </div>
    <div class="btn">
    	<img src="img/share.png">
        <span>分享</span>
    </div>
    <a class="buy-now" onclick="buy()">立即购买</a>
</div>
<script type="text/javascript">
    $(function() {
        var productId=GetQueryString("productId");
        var data = JSON.stringify({
            "productId": productId
        });

        var succrss = (data) => {
//        console.log(data.message.code);
            var liHtml="";
            var pagenavi1="";
            var pictures=data.data.picture;
            var pictureArray=new Array();
            if(pictures!=null){
                pictureArray=pictures.split(",")
            }
            for(var i = 0; i<pictureArray.length; i++) {
                liHtml+=`<li style='display:block'><a href="#"><img src="`+pictureArray[0]+`" alt="" /></a></li>`;
                if(i==0) {
                    pagenavi1 += `<a href="#" class="active"></a>`;
                }else{
                    pagenavi1 += `<a href="#"></a>`;
                }
            }
            $("#slider4").html(liHtml);
            $(".pagenavi1").html(pagenavi1);
            $(".title-main").html(data.data.name);
            $("#price").html(data.data.price);
            $("#freightPrice").html(data.data.freightPrice)

        };
        Hajax("post", "/supplier/product/getProductDetail", data, succrss);
    });
   function buy() {
       var productId=GetQueryString("productId");
       window.location.href = './buy-body-address.html?productId='+productId+'&productNumber='+1;
   }
</script>
<script type="text/javascript" src="js/touchslider.js"></script>
<script type="text/javascript">
    console=window.console || {dir:new Function(),log:new Function()};
    var t4=new TouchSlider('slider4',{speed:1,autoplay:true, direction:0, interval:6000, fullsize:true});
    var active=0,
        as=document.getElementById('pagenavi').getElementsByTagName('a');
    for(var i=0;i<as.length;i++){
        (function(){
            var j=i;
            as[i].onclick=function(){
                t4.slide(j);
                return false;
            }
        })();
    }
    t4.on('before',function(m,n){
        as[m].className='';
        as[n].className='active';
    })
</script>
</body> 
</html> 
